68e2d631f7edd0006be2e5c591b7456edecafc4b,gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Activator.java,Activator,start,#BundleContext#,54
Before Change
};
commandTracker.open();
felixTracker = new ServiceTracker(context, FelixCommandAdaptor.FELIX_COMMAND,
null)
{
@Override
public Object addingService(ServiceReference ref)
{
Object felixCommand = super.addingService(ref);
try
{
FelixCommandAdaptor adaptor = new FelixCommandAdaptor(felixCommand);
regs.put(ref, context.registerService(
FelixCommandAdaptor.class.getName(), adaptor,
adaptor.getAttributes()));
return felixCommand;
}
catch (Exception e)
{
System.err.println("felixcmd: " + e);
return null;
}
}
@Override
public void removedService(ServiceReference reference, Object service)
{
ServiceRegistration reg = regs.remove(reference);
if (reg != null)
reg.unregister();
super.removedService(reference, service);
}
};
felixTracker.open();
threadioRegistration = context.registerService(ThreadIO.class.getName(),
threadio, new Hashtable());
After Change
private OSGiConverters converters;
private ServiceRegistration convertersRegistration;
public void start(final BundleContext context) throws Exception
{
threadio = new ThreadIOImpl();
threadio.start();
threadioRegistration = context.registerService(ThreadIO.class.getName(),
threadio, null);
processor = new CommandProcessorImpl(threadio);
processorRegistration = context.registerService(CommandProcessor.class.getName(),
processor, null);
commandTracker = trackOSGiCommands(context);
commandTracker.open();
felixRegistrations = new HashMap<ServiceReference, ServiceRegistration>();
felixTracker = trackFelixCommands(context);
felixTracker.open();
converterTracker = new ServiceTracker(context, Converter.class.getName(), null)
{